package com.example.springclouddemo.controller;

import com.didispace.dto.User;
import com.didispace.service.HelloService;
import com.netflix.discovery.converters.Auto;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


@RestController
public class RefactorHelloController implements HelloService {
    @Override
    public String hello(String name) {
        return "hello:" + name;
    }

    @Override
    public User hello(String name, Integer age) {
        return new User(name, age);
    }

    @Override
    public String hello(User user) {
        return "hello " + user.getName() + "," + user.getAge();
    }

}
